#!/usr/bin/env python3
"""
V2ray订阅链接自动获取脚本配置文件
所有配置常量都在这里定义，方便全局修改
"""

# ==================== 目录配置 ====================
# 输出目录配置（默认）
OUTPUT_DIR = "/var/lib/jenkins/workspace/output/proxy"
# 区分环境的输出目录（可选）
# 开发环境目录
OUTPUT_DIR_DEV = "~/Python/proxy"
# 生产环境目录
OUTPUT_DIR_PROD = "/var/lib/jenkins/workspace/output/proxy"
# 日志文件配置
LOG_FILE = OUTPUT_DIR + "/proxy_fetcher.log"

# ==================== 网络配置 ====================
# GitHub页面配置
GITHUB_URL = "https://github.com/shareclash/shareclash.github.io"
# 基础URL配置
BASE_URL = "https://shareclash.github.io/uploads"
# 重试次数配置
MAX_RETRIES = 3
# 请求超时配置（秒）
REQUEST_TIMEOUT = 30
# 是否优先从GitHub解析链接
PRIORITY_GITHUB_PARSE = True

# 额外订阅：free-nodes 原始订阅源
FREE_NODES_URL = "https://raw.githubusercontent.com/free-nodes/v2rayfree/main/v2"
FREE_NODES_V1_URL = "https://raw.githubusercontent.com/free-nodes/v2rayfree/main/v1"

# 额外订阅：free-nodes 原始订阅源
FREE_NODES_URL = "https://raw.githubusercontent.com/free-nodes/v2rayfree/main/v2"

# ==================== 执行配置 ====================
# Cron执行时间（每天凌晨2点）
CRON_TIME = "0 2 * * *"
# 订阅链接数量
SUBSCRIPTION_COUNT = 5

# ==================== 文件权限配置 ====================
# 输出目录权限
OUTPUT_DIR_PERMISSIONS = 0o755  # 755
# 日志文件权限
LOG_FILE_PERMISSIONS = 0o644    # 644

# ==================== 用户代理配置 ====================
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'

# ==================== 日志配置 ====================
# 日志级别
LOG_LEVEL = "INFO"
# 日志格式
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'

# ==================== 验证配置 ====================
# 是否验证获取的内容
VALIDATE_CONTENT = True
# 最小内容长度（字符）
MIN_CONTENT_LENGTH = 10
